< previous page page_226 next page >

Page 226
refresh the screen more frequently than those that use an interlaced scan do. A typical progressive scan monitor might refresh its screen 60 or more times per second.
Timing Is Everything
If you present an animation's images too slowly, the motion appears jerky. Presenting images too quickly can also cause problems. If you display images faster than the computer's monitor can update, some of the images may never be visible. This can make the animation appear jerky or produce even stranger effects.
Suppose you have a series of images showing a person running. The person starts with right foot extended, draws the right leg back while putting the left foot forward, and then draws the left leg back while moving the right foot forward again. This cycle of right foot forward to right foot forward requires 10 images.
Now suppose that you present the images 10 times as fast as your monitor can display them. As a result, only every 10th image is visible. All the images presented show your runner with the right foot extended in front. To an observer, the sequence appears to show the runner sliding along the ground with right foot forward.
If you present the images nine times as fast as your monitor can display them, each image will come from a little earlier in the right foot forward to right foot forward cycle. When you run the images together, the person will seem to run backwards, even though the ground underneath indicates that the person is moving forward.
These effects are forms of temporal aliasing. By not displaying every image in the appropriate sequence, you have removed important visual information from the animation and created the illusion of motion that does not really exist.
A final problem with displaying images too quickly occurs if you update the image being displayed while your monitor is in the middle of a refresh cycle. In that case, the top half of the screen may show part of one image while the bottom half shows part of another. If the timing is right and this sort of thing occurs frequently, you can see a horizontal line where the two images meet. You may even be able to see the two halves of the images moving independently. The top half of a person running might seem to be slightly in front of the bottom half. Because the image appears torn in the middle, this problem is called image tearing.
To prevent all of these problems, you should not display images faster than your monitor can update them. Doing things too quickly is usually not a problem in Visual Basic, but it may be an issue on some of the most modern computers. In one test of the Bmp-Play program described later in this chapter, a 133MHz Pentium processor was able to display a 250 by 250 pixel image roughly 55 times per second. The progressive scan monitor used refreshed itself 60 times per second. This is just fast enough to avoid temporal aliasing problems.
If you run a simple animation on a 400MHz Pentium III with a fast graphics accelerator, you may encounter these problems. In that case, you will need to take special care in timing your animations' frames.

 
< previous page page_226 next page >